<?php
/**
 * Created by PhpStorm.
 * User: XQLS_PC
 * Date: 2017/3/11
 * Time: 8:06
 */
$arr=array(array('姓名'=>"xiaohong","年龄"=>12,"性别"=>"nan"),array('姓名'=>"xiaoming","年龄"=>15,"性别"=>"女"),array('姓名'=>"xiaogang","年龄"=>66,"性别"=>"nan"));
//foreach($arr as $key => $value){
//    echo $value['name'];
//    echo "<hr>";
//}


include_once './tpl.html';

$len=count($arr);
echo "<table border='1'>";

for($i=0;$i<$len;$i++){
    echo "<tr>";

    foreach($arr[$i] as $key => $v){
        if($i==1){

            echo "<td style='background-color: red'>";
            echo $key;
            echo "</td>";
            echo "<td style='background-color: red'>";
            echo $v;
            echo "</td>";
        }else{
            echo "<td>";
            echo $key;
            echo "</td>";
            echo "<td>";
            echo  $v;
            echo "</td>";
        }

    }
    echo "<td><a href='add.php?p={$i}'> 操作</a></td>";
    echo "</tr>";


}



echo "</table>";